#ifndef _WX_SNGLINST_H_
#define _WX_SNGLINST_H_

#if wxUSE_SNGLINST_CHECKER

// ----------------------------------------------------------------------------
// wxSingleInstanceChecker
// ----------------------------------------------------------------------------

class wxSingleInstanceChecker {
  public:
    // default ctor, use Create() after it
    wxSingleInstanceChecker() { Init(); }

    // like Create() but no error checking (dangerous!)
    wxSingleInstanceChecker( const wxString& name,
                             const wxString& path = wxEmptyString ) {
      Init();
      Create( name, path );
    }

    bool Create( const wxString& name, const wxString& path = wxEmptyString );

    // is another copy of this program already running?
    bool IsAnotherRunning() const;

    // dtor is not virtual, this class is not meant to be used polymorphically
    ~wxSingleInstanceChecker();

  private:
    // common part of all ctors
    void Init() { m_impl = NULL; }

    // the implementation details (platform specific)
    class wxSingleInstanceCheckerImpl *m_impl;

    DECLARE_NO_COPY_CLASS( wxSingleInstanceChecker )
};

#endif // wxUSE_SNGLINST_CHECKER

#endif // _WX_SNGLINST_H_
